package com.jniproject;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.Arrays;

/**
 * Created by zhangyingjie on 2021/1/29
 *
 * @function
 */
public class BookJava  {

    // 名字
    public String title;
    public String author;
    public String subject;

    // 序列号
    public int book_id;
    public long mBookPoint;
    public float bookPriceFloat;
    public float[] bookPriceFloatS;

    public BookJava() {
//        mBookPoint = nativeInit();
    }
//    private static native long nativeInit();


    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getSubject() {
        return subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public int getBook_id() {
        return book_id;
    }

    public void setBook_id(int book_id) {
        this.book_id = book_id;
    }

    public long getmBookPoint() {
        return mBookPoint;
    }

    public void setmBookPoint(long mBookPoint) {
        this.mBookPoint = mBookPoint;
    }

    public float getBookPriceFloat() {
        return bookPriceFloat;
    }

    public void setBookPriceFloat(float bookPriceFloat) {
        this.bookPriceFloat = bookPriceFloat;
    }

    public float[] getBookPriceFloatS() {
        return bookPriceFloatS;
    }

    public void setBookPriceFloatS(float[] bookPriceFloatS) {
        this.bookPriceFloatS = bookPriceFloatS;
    }

/*
//    Parcelable 序列化
    protected BookJava(Parcel in) {
        readFromParcel(in);
    }

    public static Creator<BookJava> getCREATOR() {
        return CREATOR;
    }

    private void readFromParcel(Parcel in) {
        title = in.readString();
        author = in.readString();
        subject = in.readString();
        book_id = in.readInt();
        mBookPoint = in.readLong();
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(title);
        dest.writeString(author);
        dest.writeString(subject);
        dest.writeInt(book_id);
        dest.writeLong(mBookPoint);
    }

    public static final Creator<BookJava> CREATOR = new Creator<BookJava>() {
        @Override
        public BookJava createFromParcel(Parcel in) {
            return new BookJava(in);
        }

        @Override
        public BookJava[] newArray(int size) {
            return new BookJava[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }
//    Parcelable 序列化 结束
*/


    @Override
    public String toString() {
        return "BookJava{" +
                "title='" + title + '\'' +
                ", author='" + author + '\'' +
                ", subject='" + subject + '\'' +
                ", book_id=" + book_id +
                ", mBookPoint=" + mBookPoint +
                ", bookPriceFloat=" + bookPriceFloat +
                ", bookPriceFloatS=" + Arrays.toString(bookPriceFloatS) +
                '}';
    }


}
